package environment;

import java.util.Vector;

public class Population {
	private int populationId;
	private int carryCapacity;
	private boolean stochasticEvent;//true-> 100%, false -> 20%
	private double probabiltyOfStochasticEvent;//value between 0-1
	private double disperseProbabilty;//value between 0-1
	
	private Vector<DPBF> females;
	private Vector<DPBM> males;
	
	/**
	 * 
	 * @param id of the Population
	 * @param carryCapacity, The maximum size of the population
	 * @param stochasticEvent, true-> 100%, false -> 20%
	 * @param probabiltyOfStochasticEvent, value between 0-1
	 * @param disperseProbabilty, value between 0-1
	 */
	public Population(int id, int carryCapacity,boolean stochasticEvent,double probabiltyOfStochasticEvent,double disperseProbabilty){
		this.populationId = id;
		this.carryCapacity = carryCapacity;
		this.stochasticEvent = stochasticEvent;
		this.probabiltyOfStochasticEvent = probabiltyOfStochasticEvent;
		this.disperseProbabilty = disperseProbabilty;
		this.females = new Vector<DPBF>();
		this.males = new Vector<DPBM>();
	}
	
	/**
	 * Create a random population of DPMF
	 * @param amountOfFemalesInPopulation of the wanted population
	 */
	public void createRandomPopulation(int amountOfFemalesInPopulation){
		//adding "size" DPBF beetles
		for (int i = 0; i < amountOfFemalesInPopulation; i++) {
			females.add(new DPBF(Genotype.randomGenotype(), populationId, new Id()));
		}
		//adding "size" DPBF beetles
		for (int i = 0; i < amountOfFemalesInPopulation/30; i++) {
			//TODO: Add correct parameter
			males.add(new DPBM(new Id()));
		}
		
	}//end of create Random Population
	
	
}
